/********************************
 *版权所有 CopyRight(c) 快程乐码信息有限公司所有，未经授权，不得复制、转发
 */
package com.yjx.test.dozer;

import com.yjx.test.dozer.entity.AEnum;
import com.yjx.test.dozer.entity.Account;
import com.yjx.test.dozer.entity.Gender;
import com.yjx.test.dozer.entity.MultiFiled;
import com.yjx.test.dozer.utils.DataConvertor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;

/************
 *@Author yejx
 *@version v1.0
 *@create 2020/7/1 9:22
 *@Description TODO
 *
 */
@SpringBootTest
public class DozerApplicationTests2 {
    @Autowired
    DataConvertor dataConvertor;

    @Test
    public void test() {
        List<Account> accounts = Arrays.asList(
                new Account(1, "叶建雄", "123456", 12.99, LocalDate.of(1996, 9, 28)),
                new Account(2, "谭建", "123456", 12.99, LocalDate.of(1996, 9, 28)),
                new Account(3, "张一峰", "123456", 12.99, LocalDate.of(1996, 9, 28)),
                new Account(4, "张琦", "123456", 12.99, LocalDate.of(1996, 9, 28))
        );
        List<AEnum> aEnums = Arrays.asList(
                new AEnum("码畜", Gender.男),
                new AEnum("码畜", Gender.女),
                new AEnum("码畜", Gender.女),
                new AEnum("码畜", Gender.男)
        );
        List<MultiFiled> convertor = dataConvertor.convertor(accounts, MultiFiled.class);

    }

    @Test
    public void test1() {
        MultiFiled multiFiled = new MultiFiled();
        Account a = new Account(1, "叶建雄", "123456", 12.99, LocalDate.of(1996, 9, 28));
        AEnum ae = new AEnum("码畜", Gender.男);
        dataConvertor.convertor(a, MultiFiled.class);
        System.out.println(multiFiled);
    }

    @Test
    public void test2() {


    }

}
